package org.listbeast.core.dataobjects;

/**
 * Represents a single song entry
 * 
 */
public class Song {

	private final String title;
	private final String artistName;
	
	public Song(String artistName, String title) {
		this.title = title;
		this.artistName = artistName;
	}

	public String getTitle() {
		return title;
	}

	public String getArtistName() {
		return artistName;
	}

	@Override
	public String toString() {
		return "Song : title=" + title + ", artistName=" + artistName;
	}
	
	@Override
	public int hashCode() {
		return title.hashCode() + artistName.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Song) {
			Song song = (Song) obj;
			if (song.getTitle().equals(this.getTitle())
					&& song.getArtistName().equals(this.getArtistName())) {
				return true;
			} else {
				return false;
			}
		} else {
			return false;
		}
	}
	
}
